﻿using CNFM_CROCODILE_LOGO.Core.Domain.Entity;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace CNFM_CROCODILE_LOGO.Data.Mappings.DataMappings
{
    /// <summary>
    /// 标识牌
    /// </summary>
    public class IdentificationMap : IBaseEntityTypeConfiguration
    {
        public IdentificationMap(ModelBuilder builder)
        {
            builder.Entity<Identification>(b =>
            {
                b.Property(e => e.Id)
                .HasMaxLength(36)
                .IsUnicode(false)
                .ValueGeneratedNever();

                b.Property(e => e.Status)
                     .IsUnicode(false)
                     .HasColumnType("int")
                     .HasDefaultValue(0);

                b.Property(e => e.CreateId)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false);

                b.Property(e => e.CreateTime)
                    .HasColumnType("datetime")
                    .HasDefaultValueSql("(getdate())");

                b.Property(e => e.Remarks)
                    .HasMaxLength(200)
                    .IsUnicode(false);

                b.Property(e => e.RegisteredTime)
                   .HasColumnType("datetime")
                   .HasDefaultValueSql("(getdate())");

                b.Property(e => e.IdentificationNo)
                   .IsRequired()
                   .HasMaxLength(50)
                   .IsUnicode(false);

                b.Property(e => e.SignageApplicationReceiptId)
                  .IsRequired()
                  .HasMaxLength(50)
                  .IsUnicode(false);

                b.Property(e => e.SpeciesManageId)
                  .IsRequired()
                  .HasMaxLength(50)
                  .IsUnicode(false);

                b.Property(e => e.EnterpriseId)
                  .IsRequired()
                  .HasMaxLength(50)
                  .IsUnicode(false);

                b.Property(e => e.QRCode)
                 .IsRequired()
                 .HasMaxLength(50)
                 .IsUnicode(false);
            });
        }
    }
}
